package com.example.networkchangedemo.weight;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.PopupWindow;

import com.example.networkchangedemo.R;

/**
 * @author: njb
 * @date: 2022/2/17 14:53
 * @desc: 引导弹框
 */
public class TipPopupWinDow extends PopupWindow {
    private View view;
    FrameLayout flTip;

    public TipPopupWinDow(Activity context,int width, int height, boolean focusable){
        view = LayoutInflater.from(context).inflate(R.layout.layout_tip_popup_window, null);
        flTip = view.findViewById(R.id.fl_tip);
        setContentView(view);
        setTouchable(true);
        setHeight(height);
        setWidth(width);
        setOutsideTouchable(true);
        initView();
    }

    private void initView() {
        flTip.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                TipPopupWinDow.this.dismiss();
            }
        });
    }
}
